<template>
	<view class="content">
		
		<view class="user-info">
			
			<view class="user-tx">
				<image :src="info.avatar" mode=""></image>
			</view>
			
			<view class="user-name">
				<text class="name">{{info.username}}</text>
				<text class="phone">手机号：{{info.mobile}}</text>
			</view>
			
			<image class="user-info-bg" style="width: 115rpx;height: 115rpx;" src="https://s1.ax1x.com/2022/11/18/znVVat.png" mode=""></image>
		</view>
		
		<!-- 其他功能 -->
		<view class="gongnneg">
			
			<view class="my-title-box">
				<view class="my-title">其他功能</view>
				<!-- <view class="more">查看全部</view> -->
			</view>
			
			
			<view class="gongnneg-li" style="margin-top: 40rpx;" @click="jump('../xihead_dingdan/xihead_dingdan')">
				<view class="gongnneg-left">
					<image style="width: 32rpx;height: 35rpx;" src="https://s1.ax1x.com/2022/11/18/znsFVH.png" mode=""></image>
					<text>维修订单</text>
				</view>
				
				<view class="gongnneg-right">
					<image style="width: 10rpx;height: 18rpx;" src="https://s1.ax1x.com/2022/11/18/znVCxe.png" mode=""></image>
				</view>
				
			</view>
			
		<!-- 退出登陆 -->
		<button class="u-reset-button btn1" @click="outLogin">退出登录</button>
		<u-modal v-model="show" :content="content" :confirm-text="confirm_text" show-cancel-button cancel-text="取消" @confirm="qdinfo()"></u-modal>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:[],
				show:false,//弹窗
				content:'您有新的未审核订单',
				confirm_text:"去审核",
			}
		},
		onLoad() {
			this.info = JSON.parse(uni.getStorageSync('xiheadInfo'))
			this.info.avatar = this.$IMG_URL +this.info.avatar
			// this.checkinfo()
		},
		methods: {
			//判断是否有新审核订单
			checkinfo(){
				//console.log(111)	
				
				if(uni.getStorageSync('xiheadToken')){
					// console.log(uni.getStorageSync('xiheadToken'))
					this.$u.post('admin/check_order',{}).then(res =>{
									
						if(res.data.count == 0){
							//console.log('已经审核')
							
						}else{
							console.log('去审核')
							this.content = '您有  '+res.data.count+'  个新的未审核订单',
							this.show = true		
						}
										
						
					})
				}
			},
			qdinfo(){				
					uni.navigateTo({
						url:'../xihead_dingdan/xihead_dingdan'
					})				
			},
			jump(url){
				uni.navigateTo({
					url:url
				})
			},
			// 退出登录
			outLogin(){
				uni.showModal({
					title: '温馨提示',
					content: '确定要退出登录吗？',
					success: function (res) {
						if (res.confirm) {
							uni.showToast({
								icon:'success',
								title:'退出成功'
							})
							 uni.removeStorageSync('xiheadToken')
							setTimeout(()=>{
								uni.switchTab({
									url:'/pages/user/index/index'
								})
							},800)
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
		}
	}
</script>

<style lang="less">
.content{
	background-image: linear-gradient(0deg, #0055B0 0%, #0184D0 100%);
	background-repeat: no-repeat;
	background-size: 100% 246rpx;
	padding-bottom: 100rpx;
}

.user-info{
	position: relative;
	height: 220rpx;
	display: flex;
	// align-items: center;
	padding-top: 38rpx;
	padding-left: 37rpx;
	box-sizing: border-box;
	.user-tx{
		width: 114rpx;
		height: 114rpx;
		border-radius: 50%;
		overflow: hidden;
		margin-right: 33rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #fff;
		border: 4rpx solid rgba(255, 255, 255, 0.42);
		image{
			width: 106rpx;
			height: 106rpx;
		}
	}
	.user-name{
			display: flex;
			flex-direction: column;
			margin-top: 12rpx;
			.name{
				font-size: 42rpx;
				font-weight: bold;
				color: #fff;
				margin-bottom: 9rpx;
			}
			.phone{
				font-size: 32rpx;
				color: #F6F6F6;
			}
		}
	}
.user-info-bg{
	position: absolute;
	right: -20rpx;
	bottom: 2rpx;
}
.my-order{
	background: #fff;
	border-radius: 0px 0px 10rpx 10rpx;
	margin-top: 22rpx;
	padding-top: 40rpx;
}
.my-title-box{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 30rpx;
	position: relative;
	overflow: hidden;
	.my-title{
		font-weight: 800;
		font-size: 44rpx;
		display: flex;
		align-items: center;
		&::after{
			content: "";
			width: 20rpx;
			height: 20rpx;
			border-radius: 50%;
			position: absolute;
			left: -10rpx;
			background: #0055B0;
		}
	}
	.more{
		font-size: 24rpx;
		color: #999999;
	}
}
.my-order-list{
	padding: 0 30rpx;
	display: flex;
	justify-content: space-between;
	margin-top: 51rpx;
	padding-bottom: 40rpx;
}
.my-order-li{
	display: flex;
	flex-direction: column;
	justify-items: center;
	align-items: center;
	.image{
		position: relative;
		margin-bottom: 22rpx;
	}
	image{
		width: 100%;
		height: 100%;
	}
	text{
		font-size: 24rpx;
		color: #646464;
	}
}
.gongnneg{
	background: #fff;
	margin-top: 20rpx;	
	border-radius: 10rpx;
	padding-top: 40rpx;
}
.gongnneg-li{
	padding: 0 10rpx;
	border-top: 1px solid #EEEEEE;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 98rpx;
}
.gongnneg-left{
	display: flex;
	align-items: center;
	justify-content: space-between;
	image{
		margin-right: 13rpx;
		    width: 23px !important;
		    height: 22px !important;
	}
	text{
		font-size:38rpx;
	}
}
.gongnneg-right{

	image{
		        width: 9px !important;
		        height: 13px !important;
	}
}
.tab-li{
		font-size: 39rpx;
	}
	.tab-li.active {
		font-weight: bold;
		color: #0055B0;
	}
.btn1{
	height: 100rpx;
	font-size: 49rpx;
	margin-top: 200rpx;
	background: #0055B0;
	border-radius: 40rpx;
	margin: 0 auto;
	margin-top: 450rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	}
</style>
